home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7498 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.6 KB

  1. Path: yama.mcc.ac.uk!usenet
  2. From: Christos Dimitrakakis <mbge4cd1@fs1.ee.man.ac.uk>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: 680X0 -> PPC translator?
  5. Date: Wed, 17 Apr 1996 17:53:11 +0100
  6. Organization: Sirius Cybernetics Corporation
  7. Message-ID: <317521F7.56BA@fs1.ee.man.ac.uk>
  8. References: <31499F8E.26A9@netvision.net.il> <volker.0fw1@vb.franken.de> <19960408.40F118.E8F9@an052.du.pipex.com> <316BD11F.69A7@netvision.net.il> <19960410.413918.CA24@aj158.du.pipex.com> <316FE1A5.3A1F@netvision.net.il> <19960413.4A71D0.E501@an089.du.pipex.com> <3174A593.5045@sapiens.com>
  9. NNTP-Posting-Host: meehph.ee.man.ac.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (X11; I; HP-UX A.09.03 9000/715)
  14.  
  15. Static translators cannot work. 
  16. You would be better off with a semi-dynamic translator.
  17. Why?
  18.     Even the problem of loading a  program in memory
  19. is almost insoluble, if the program contains data. 
  20. Let's say you trace all calls and rets etc, so that you can
  21. exclude some part of the data of been executable.
  22. But how about indexed calls? You cannot handle those statically,
  23. especially if they are taking data from a variable index
  24. specifying a variable memory location.
  25.  
  26. Anyway, the best way to go is semi-static translation.
  27. How it will work?
  28. The same way as a cache!
  29. Everytime the Virtual Program Counter (VPC) reaches a new address,
  30. the Virtual Cache (VCache) is checked to see if that address is
  31. contained.
  32. If it is, the corresponding PPC command in the VCache is executed,
  33. else the 68k code is interpreted and is placed into the VCache as a PPC
  34. instruction, which then can be executed from the VCache directly.
  35. By careful design of the VCache, most programs can be executed from
  36. VCache memory 99% of the time and the supervising program will not
  37. have to interfere a lot.
  38. Note, though, that you must provide a place where the original data is
  39. stored , which must be seperate from VCache memory.
  40. In essence, this method is a cached dynamic translation method, where
  41. parts of code that have already been translated, need not be translated
  42. again.
  43. And if it is speed that you're looking for, then this is your answer.
  44.  
  45.  
  46. As for more examples of how you can have code that is impossible to
  47. translate
  48. statically, I suggest you look at the protection methods used by some of
  49. the
  50. spectrum programmers back in the 80s, which did not rely in strange tape
  51. formatting, but in strange assembler programming - producing code that
  52. cannot
  53. be statically translated. I've read some articles about some of the
  54. protection
  55. mechanisms and believe me, they were weird.
  56.